package com.behome.netty.netty_D.handler;

import com.behome.netty.netty_B.bean.*;
import com.behome.netty.netty_D.bean.Packet;
import com.behome.netty.netty_D.bean.TerminalDHeartBeat;
import io.netty.channel.ChannelHandlerContext;
import lombok.extern.slf4j.Slf4j;

import java.net.InetSocketAddress;

@Slf4j
public class TerminalDHeartBeatHandler extends BusinessDHandlerBase {

    public TerminalDHeartBeatHandler(ChannelHandlerContext ctx, Packet msg, int type) {
        super(ctx, msg, type);
    }

    @Override
    public void resolve() {
        try {
            TerminalDHeartBeat heartBeat = (TerminalDHeartBeat) this.msg.getBody().getBusinessCmd();
            log.info(this.ip + ":" + heartBeat.toCHJsonString());
        } catch (Exception e) {
            log.error("发生异常", e);
        }
    }
}